function userData(tabId, machineName, username, password)
{
  this.tabId = tabId;
  this.machineName = machineName;
  this.username = username;
  this.password = password;
}

function debug(msg)
{
  console.debug(msg);
}

function getElement(id)
{
  return document.getElementById(id);
}

function getInputValue(id)
{
  var element = getElement(id);

  if(element == null)
    throw("Could not find element with id:"+id);

  return element.value;
}

function getPasswordValue(id)
{
  return getInputValue(id);
}

function getBackgroundPage()
{
  var backgroundPage = chrome.extension.getBackgroundPage();

  if(!backgroundPage)
    throw("Background page not available!");

  return backgroundPage;
}
